\doxysection{Binary\+Tree$<$ Comparable $>$ Class Template Reference}
\label{class_binary_tree}\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}


Base class for trees.  




{\ttfamily \#include $<$Binary\+Tree.\+h$>$}



Inheritance diagram for Binary\+Tree$<$ Comparable $>$\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_binary_tree__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for Binary\+Tree$<$ Comparable $>$\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=277pt]{class_binary_tree__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ Node}
\begin{DoxyCompactList}\small\item\em Basis struct for all nodes. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Binary\+Tree} ()
\item 
virtual \textbf{ $\sim$\+Binary\+Tree} ()
\item 
void \textbf{ print\+Tree} (ostream \&out=cout) const
\item 
void \textbf{ make\+Empty} ()
\item 
virtual void \textbf{ insert} (const Comparable \&x)
\item 
virtual void \textbf{ insert} (Comparable \&\&x)
\item 
virtual void \textbf{ remove} (const Comparable \&x)
\item 
virtual void \textbf{ remove} (Comparable \&\&x)
\end{DoxyCompactItemize}
\doxysubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\textbf{ Node} $\ast$ \textbf{ root} = nullptr
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Comparable$>$\newline
class Binary\+Tree$<$ Comparable $>$}

Base class for trees. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Comparable} & \\
\hline
\end{DoxyTemplParams}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\label{class_binary_tree_a48948ead687bb359964378fc9f96e962}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!BinaryTree@{BinaryTree}}
\index{BinaryTree@{BinaryTree}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{BinaryTree()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
\textbf{ Binary\+Tree}$<$ Comparable $>$\+::\textbf{ Binary\+Tree} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Construct a new Binary Tree object \mbox{\label{class_binary_tree_afb2c568c63382a2f67f6f0de2a3113e7}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!````~BinaryTree@{$\sim$BinaryTree}}
\index{````~BinaryTree@{$\sim$BinaryTree}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{$\sim$BinaryTree()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual \textbf{ Binary\+Tree}$<$ Comparable $>$\+::$\sim$\textbf{ Binary\+Tree} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Destructor for the tree 

\doxysubsection{Member Function Documentation}
\mbox{\label{class_binary_tree_aee7222ca2a42b69a5703eb8f77ee2842}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!insert@{insert}}
\index{insert@{insert}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{insert()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::insert (\begin{DoxyParamCaption}\item[{Comparable \&\&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Reimplemented in \textbf{ Splay\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_splay_tree_adde9d24f5ea5c441e0cee83cce7afedd}, \textbf{ Avl\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_avl_tree_ad9feb22f565e013c60176ab0dc7adba4}, and \textbf{ Bst\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_bst_tree_ad1fd360ecaf13dd46d1b3e4030647af1}.

\mbox{\label{class_binary_tree_af588056c5cd620cdb6b66e7db4e706b8}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!insert@{insert}}
\index{insert@{insert}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{insert()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::insert (\begin{DoxyParamCaption}\item[{const Comparable \&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Insert x into the tree; duplicates are ignored. 

Reimplemented in \textbf{ Splay\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_splay_tree_a8aee728cd2536dc8306129fa64c1f694}, \textbf{ Avl\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_avl_tree_aff480dbd38c3803011882dab799871dc}, and \textbf{ Bst\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_bst_tree_a8c92bedb44279045795259b36031c725}.

\mbox{\label{class_binary_tree_af1cb2a82a7837713d1d0e71cd90a76a0}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!makeEmpty@{makeEmpty}}
\index{makeEmpty@{makeEmpty}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{makeEmpty()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::make\+Empty (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Make the tree logically empty. \mbox{\label{class_binary_tree_a2ed034626b76cf27efe77bce17604bc4}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!printTree@{printTree}}
\index{printTree@{printTree}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{printTree()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::print\+Tree (\begin{DoxyParamCaption}\item[{ostream \&}]{out = {\ttfamily cout} }\end{DoxyParamCaption}) const}

Print the tree contents. \mbox{\label{class_binary_tree_aacd21ed74feac2218b95bea652f9f399}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!remove@{remove}}
\index{remove@{remove}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{remove()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::remove (\begin{DoxyParamCaption}\item[{Comparable \&\&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Reimplemented in \textbf{ Splay\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_splay_tree_af020a5b6cf5934071739aad949802edd}, \textbf{ Avl\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_avl_tree_ab79e0850047dec805260735bb35d1b51}, and \textbf{ Bst\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_bst_tree_a0251edb51327b40d42e576c885c24334}.

\mbox{\label{class_binary_tree_a1fe5e6e0b3266169eaaf8e16997c804e}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!remove@{remove}}
\index{remove@{remove}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{remove()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::remove (\begin{DoxyParamCaption}\item[{const Comparable \&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Remove x from the tree. Nothing is done if x is not found. 

Reimplemented in \textbf{ Splay\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_splay_tree_a4dfaad055380b8384d9365823e224bf0}, \textbf{ Avl\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_avl_tree_af87eb93a5639ae6d3661ce1c93680e14}, and \textbf{ Bst\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_bst_tree_a7cb0b1bd945708ccf9e4af1905b6ac95}.



\doxysubsection{Member Data Documentation}
\mbox{\label{class_binary_tree_a5f3b3e7aab67967fe53c46f532fb311c}} 
\index{BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}!root@{root}}
\index{root@{root}!BinaryTree$<$ Comparable $>$@{BinaryTree$<$ Comparable $>$}}
\doxysubsubsection{root}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
\textbf{ Node}$\ast$ \textbf{ Binary\+Tree}$<$ Comparable $>$\+::root = nullptr\hspace{0.3cm}{\ttfamily [private]}}



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\textbf{ Binary\+Tree.\+h}\end{DoxyCompactItemize}
